﻿using System;
using System.Collections.Generic;
using System.Text;

namespace spec_unsafe
{
    struct DirtyStruct
    {
        public int a;
        public int b;
        public string abc;
    }

    struct CleanStruct
    {
        public int a;
        public int b;
        unsafe fixed char abc[8];
    }
    class stack
    {
        static void CallWithGC()
        {
            DirtyStruct[] s = new DirtyStruct[10];
        }
        static void CallNoGC()
        {
            unsafe
            {
                CleanStruct* ptr = stackalloc CleanStruct[10];
                Span<CleanStruct> span = stackalloc CleanStruct[10];//出栈即毁灭，不用卸载
                var spansugar = (stackalloc CleanStruct[10]); 
            }
        }
        void dump()
        {
            //char txt = '𪚥';
        }
    }
}
